/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modele;

/**
 *
 * @author Alex
 */



public class Expense {
    protected Integer idExpense;
    protected String description;
    protected Status status;
    protected Float amountPaidByCustomer;
    protected Float reimburseRate;
    protected Float amountToReimburse;

    public Expense(String desc, Float amountPaid) {
        this.description = desc;
        this.amountPaidByCustomer = amountPaid;
        this.reimburseRate = (Float)0.0f;
        this.amountToReimburse = (Float)0.0f;
        this.status = Status.MISSINGJUSTIFICATION;
    }

    public Float getAmountPaidByCustomer() {
        return amountPaidByCustomer;
    }

    public void setAmountPaidByCustomer(Float amountPaidByCustomer) {
        this.amountPaidByCustomer = amountPaidByCustomer;
    }

    public Float getAmountToReimburse() {
        return amountToReimburse;
    }

    public void setAmountToReimburse(Float amountToReimburse) {
        this.amountToReimburse = amountToReimburse;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getIdExpense() {
        return idExpense;
    }

    public void setIdExpense(Integer idExpense) {
        this.idExpense = idExpense;
    }
    
    public Float getReimburseRate() {
        return reimburseRate;
    }

    public void setReimburseRate(Float reimburseRate) {
        this.reimburseRate = reimburseRate;
    }

    public Status getStatus() {
        return status;
    }

    /* This method simulates that the employee found a justification for
       the expense (a bill for example) and adds it to the claim file */
    public void provideJustification() {
        status = Expense.Status.WAINTINGFORAPPROVAL;
    }

    public void approve() {
        status = Expense.Status.APPROVED;
    }

    public void reject() {
        status = Expense.Status.REJECTED;
    }

    public void calculateReimbursement() {
        amountToReimburse = amountPaidByCustomer * reimburseRate;
    }
    
    public enum Status {
    APPROVED, REJECTED, MISSINGJUSTIFICATION, WAINTINGFORAPPROVAL;
    }
}

